// Include gtk
#include <gtk/gtk.h>

static cairo_surface_t * drawboard = NULL;

// static void
// clear_surface(void)
// {
// 	cairo_t * cr;
// 	cr=cairo_create(surface);
// 	cairo_set_source_rgb (cr,1,1,1);
// 	cairo_print(cr);
// 	cairo_destoru(cr);
// }

// static void
// resize_cb(GtkWidget * widget,
// 		  int         width,
// 		  int         height,
// 		  gpointer    data)
// {
// 	if(surface)
// 	{
// 		cairo_surface_destory(sutface);
// 		surface=NULL;
// 	}
// 	if(gtk_native_get_surface(gtk_widget_get_native(widget)))
// 	{
// 		surface=gdk_surface_create_similar_surface(gtk_native_get_sutface(gtk_widget_get_native(widget)),
//    				                                   CAIRO);
static void on_activate (GtkApplication *app){
  // Create a new window
  GtkWidget *window = gtk_application_window_new (app);
  // Create a new button
  GtkWidget *button = gtk_button_new_with_label ("Hello, World!");
  // When the button is clicked, close the window passed as an argument
  g_signal_connect_swapped (button, "clicked", G_CALLBACK(gtk_window_close), window);
  gtk_window_set_child (GTK_WINDOW (window), button);
  gtk_window_present (GTK_WINDOW (window));
}

int main (int argc, char *argv[]){
  // Create a new application
  GtkApplication *app = gtk_application_new ("ltd.fangyan.blog",
                                             G_APPLICATION_FLAGS_NONE);
  g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
  return g_application_run (G_APPLICATION (app), argc, argv);
}

